//
//  KSLanguageManager.h
//  INMOTION
//
//  Created by Kyle Sun on 8/6/15.
//  Copyright (c) 2015 Inmotion. All rights reserved.
//

#import <Foundation/Foundation.h>

extern NSString * const kIMTAppLanguageKey;
extern NSString * const kIMTChinesePrefix;

extern NSString * const kIMTSystemLanguagePrefix;
extern NSString * const kIMTSimplifiedChinesePrefix;
extern NSString * const kIMTTraditionnalChinesePrefix;
extern NSString * const kIMTEnglishPrefix;
extern NSString * const kIMTKoreanPrefix;
extern NSString * const kIMTRussianPrefix;
extern NSString * const kIMTSpainPrefix;
extern NSString * const kIMTFrenchPrefix;//法语

extern NSString * const kIMTSystemLanguageName;
extern NSString * const kIMTEnglishLanguageName;
extern NSString * const kIMTSimplifiedChineseLanguageName;
extern NSString * const kIMTTraditionalChineseLanguageName;
extern NSString * const kIMTKoreanLanguageName;
extern NSString * const kIMTRussianLanguageName;
extern NSString * const kIMTSpainLanguageName;
extern NSString * const kIMTFrenchLanguageName;//法语

//第一个参数:是多语言中的key
//第二个参数:是多语言文件的名字
//第三个参数:是对key的注释说明,一般传nil
#define IMTLocalizedStringFromTable(key, tbl, comment) \
[[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"appLanguage"]] ofType:@"lproj"]] localizedStringForKey:(key) value:@"" table:(tbl)]

#define IMTNewCarLocalizedString(key) IMTLocalizedStringFromTable(key, @"NewCar", nil)


extern const NSInteger kIMTChangeLanguageCode;

@interface KSLanguageManager : NSObject

+ (KSLanguageManager *)sharedInstance;

- (void)configLanguage;

- (void)setLanguage:(NSString *)language;

- (void)setLanguageWithLanguageName:(NSString *)languageName;

- (void)setUseSystemLanguage:(BOOL)use;

- (BOOL)useSystemLanguage;

- (NSString *)currentLanguage;
- (NSString *)currentLanguageName;

// 仅用于设置的时候需要显示跟随系统
- (NSString *)currentLanguageOriginal;

- (BOOL)isChinese;

- (BOOL)isChineseSimplified;

- (BOOL)isChineseTraditional;

@end
